<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<div getTime="20" data-list-name="wtf">

		</div>
		<script type="text/javascript">
			var div = document.querySelector("div");
			console.log(div.getAttribute("getTime"));
			div.setAttribute("data-time", 33);
			console.log(div.getAttribute("data-time"));
			console.log(div.getAttribute("data-list-name"));
			//H5新增获取自定义属性的方法,只能获取data-开头的
			//dataset是一个集合,里面存放着所有data-开头的自定义属性
			console.log(div.dataset);
			console.log(div.dataset['time']);
			console.log(div.dataset.time);
			console.log(div.dataset.listName);
		</script>
	</body>
</html>
